﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework;

namespace Space
{
    public class MissileGun : Gun
    {
        public Missile Missile { get; set; }
        
        public MissileGun(Ship ship) : base(ship) { }

        public override void Fire()
        {
            Missile m = new Missile(Ship)
            {
                Position = this.Position,
                Speed = Missile.Speed,
                Damage = Missile.Damage,
                Ship = Ship,
                Target = this.Target
            };
            Game.Services.GetService<IData>().AddWeapon(m);

            base.Fire();
        }
    }
}
